import { Component, OnInit,ElementRef, Renderer2,Input } from '@angular/core';

@Component({
  selector: 'el-steps',
  templateUrl: './steps.component.html'
})
export class StepsComponent implements OnInit {

    private el:any;
    private renderer:any;
    @Input() space: string | number='';
    // vertical/horizontal
    @Input() direction: string='horizontal';
    @Input() active: number=0;
    @Input() simple: boolean=false;
    @Input() processStatus: string='process';
    //wait/process/finish/error/success
    @Input() finishStatus: string ='finish';
    @Input() alignCenter: boolean =false;
    @Input() offset: number=0;
    @Input() stepsLength: number=0;
    constructor(el: ElementRef, renderer: Renderer2){
      this.el = el;
        this.renderer = renderer;
    };

  ngOnInit(): void {
    var _this = this;
        var /** @type {?} */ children = this.el.nativeElement.querySelectorAll('el-step');
        if (!children || !children.length) {
            return console.warn('steps components required children');
        }
        children.forEach(function (el:any, index:any) {
            _this.renderer.setAttribute(el, 'el-index', String(index));
        });
        this.stepsLength = children.length;
  }

}
